package com.example.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DataBaseHelper extends SQLiteOpenHelper {

    public DataBaseHelper(Context context, String name, CursorFactory factory,
            int version) {
        super(context, name, factory, version); 
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // 
        db.execSQL(DataBaseAdapter.DB_CREATE);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {
        // log the version upgrade
        Log.w("test", "Upgrading from " + arg1 + " to " + arg2);
        //
        db.execSQL("DROP TABLE IF EXISTS" + "USER");
        // create new
        onCreate(db);
    }

}
